-- GENERATED SPELL FOR [Rokir] --


function spell0_31160(pUnit, Event) --@Death and Decay,n/a--
pUnit:FullCastSpellOnTarget(61112,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31160', 10000, 1)
end

function spell1_31160(pUnit, Event) --@Plague Strike,n/a--
pUnit:FullCastSpellOnTarget(61109,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31160', 623, 1)
end

function spell2_31160(pUnit, Event) --@Zombie Horde,Self--
pUnit:FullCastSpellOnTarget(61099,pUnit)
pUnit:RegisterEvent('Sorts_31160', 6000, 1)
end

function Sorts_31160(pUnit, Event)
local choix_sorts_31160 = math.random(0, 2)
if choix_sorts_31160 == 0 then
pUnit:RegisterEvent('spell0_31160', 1, 1)
end
if choix_sorts_31160 == 1 then
pUnit:RegisterEvent('spell1_31160', 1, 1)
end
if choix_sorts_31160 == 2 then
pUnit:RegisterEvent('spell2_31160', 1, 1)
end
end

function mob31160_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31160', math.random(1500, 3000), 1)
end

function mob31160_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31160_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31160_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31160, 1, 'mob31160_Action')
RegisterUnitEvent(31160, 2, 'mob31160_Leave')
RegisterUnitEvent(31160, 3, 'mob31160_Kill')
RegisterUnitEvent(31160, 4, 'mob31160_Die')
